package com.homeinns.lyx.server.message;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MqReceiver {


    @RabbitListener(bindings = @QueueBinding(value = @Queue("rabitMQ-lyx"),exchange = @Exchange("lyxExchange")))
    public void receiveMqMessage(String message){
        System.out.println("LyxReceiverClass:{}"+message);
    }

    @RabbitListener(bindings = @QueueBinding(value = @Queue("order-lyx"),
                key = "computer-lyx",exchange = @Exchange("ComputerOrder")))
    public void processComputerOrder(String message){
        System.out.println("Receive computer order: "+message);
    }
}
